package com.example.librarygames;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class Library extends SQLiteOpenHelper {
	private static final String DATABASE_NAME = "library.db";
	private static final int DATABASE_VERSION = 1;
	private static final String DATABASE_CREATE = "create table LIBRARY("
			+ "ID INTEGER primary key autoincrement"
			+ ", NOME VARCHAR NOT NULL"
			+ ", DESCRICAO VARCHAR NOT NULL" +");";

	public Library(Context context){
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}
	@Override
	public void onCreate(SQLiteDatabase db){
		db.execSQL(DATABASE_CREATE);
	}
	
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
		db.execSQL("DROP TABLE IF EXISTS DISCIPLINAS");
		onCreate(db);
}
}